lazyload();
function lazyload(){
    let showTop = (window.innerHeight || document.documentElement.clientHeight) + (document.documentElement.scrollTop || document.body.scrollTop);
    let picObj = document.querySelectorAll('img');
    // 遍历数组
    picObj.forEach(item=>{
        if(item.offsetTop<showTop){
            item.src = item.getAttribute('rel-src');
        }
    })
}
 // 做一个节流
 let t = null;
 window.onscroll = function(){
     if(t) return
     t = setTimeout(() => {
         lazyload();
         t = null;
     }, 2000);
 }
